package com.situ.day10;

import org.junit.Test;

public class ThreadDemo {
	
	public static void main(String[] args) {
		MyThread myThread = new MyThread();
		//这不是启动一个线程，这是调用对象里面一个普通方法run()方法
		myThread.run();
		//真正启动一个线程调用start()方法，执行的代码就是run()方法里面代码
		//myThread.start();
		
		for (int i = 0; i < 100; i++) {
			System.out.println("main: " + i);
		}
	}
	
	public static void main1(String[] args) {
		MyRunnable myRunnable = new MyRunnable();
		Thread thread = new Thread(myRunnable);
		thread.start();
	}
	
}
